import React, { Component } from 'react';
import {connect} from 'react-redux';
import {actions} from './_index.js';
class View extends Component {

    constructor(props){
        super(props);
    }


    render(){
        const { id,onRemoveFn } = this.props;
        return(
            <li key={id}>{id}
                <span onClick={()=>{onRemoveFn()}}>删除</span>
            </li>
        )
    }
}
const mapStateToProps = (state)=> {
  return {

  }
}
const mapDispatchToProps = (dispatch, ownProps) => {
	const {id} = ownProps;
	return {
		onRemoveFn: () => dispatch(actions.del('删除',id))
	}
};

export default connect(mapStateToProps,mapDispatchToProps)(View);
